import json


# len(all_data)=total_number

# 打开并读取JSON文件
# with open('generative_pm/results_Llama3_self-rewarding_MTbench.json', 'r') as file:
#     data = json.load(file)["score_difference_list"]

# with open('ACL-Rebuttal/results/results_Mistral_self-rewarding_MTbench.json', 'r') as file:
#     data = json.load(file)["score_difference_list"]


# with open('ACL-Rebuttal/results/results_Llama31-70B_self-rewarding_MTbench.json', 'r') as file:
#     data = json.load(file)["score_difference_list"]


with open('ACL-Rebuttal/results/results_llama2_70b_chat_self-rewarding_MTbench.json', 'r') as file:
    data = json.load(file)["score_difference_list"]


with open('ACL-Rebuttal/results/results_llama3.1_70b_self-rewarding_MTbench.json', 'r') as file:
    data = json.load(file)["score_difference_list"]


# 打印数据
# print(data)

total_number = 1284
# total_number = 200


zero_indicator = [1 if i==0  else 0 for i in data]
tie_proportation = sum(zero_indicator)/total_number


positive_indicator = [1 if i>0  else 0 for i in data]
positive_proportation = sum(positive_indicator)/total_number


negative_indicator = [1 if i<0  else 0 for i in data]
negative_proportation = sum(negative_indicator)/total_number


print('Agreement: ', positive_proportation)
print('Disagreement: ', negative_proportation)
print('Tie: ', tie_proportation)
print('Format Mismatch: ', (total_number-len(data))/total_number)